package com.ax.base.common.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ax.base.common.dao.BaseHintMapper;
import com.ax.base.common.domain.BaseHint;
import com.ax.base.common.service.BaseHintService;

@Service
public class BaseHintServiceImpl implements BaseHintService {
	@Autowired
	BaseHintMapper baseHintMapper;

	/**
     * 查询所有提示
     *
     * @param Map<String, Object> map
     *
     * @return List<BaseHint>
     */
	@Override
	public List<BaseHint> queryBaseHintSer(Map<String, Object> params){
		List<BaseHint> baseHints = baseHintMapper.queryBaseHintMapper(params);
		return baseHints;
	}

	/**
	 * 提示配置详情(修改)
	 * 
	 * @param Long id
	 *           
	 * @return BaseHint baseHints
	 */
	@Override
	public BaseHint getBaseHint(Long id){
		BaseHint baseHints = baseHintMapper.getBaseHintMapper(id);
		String[] dz = baseHints.getAreaCode().split(",");
		baseHints.setProvince(dz[0]);
		baseHints.setCity(dz[1]);
		baseHints.setVillage(dz[2]);
		return baseHints;
	}

	/**
     * 添加提示配置
     * 
     * @param BaseHint baseHint
     * 
     * @return SUCC
     */
	@Override
	public void insertBaseHintSer(BaseHint baseHint) {
		baseHintMapper.insertBaseHintMapper(baseHint);
		
	}

	/**
     * 修改配置详情
     * 
     * @param BaseHint baseHint
     * 
     * @return SUCC
     */
	@Override
	public void updateBaseHintSer(BaseHint baseHint) {
		baseHintMapper.updateBaseHintMapper(baseHint);
	}
	
	
}
